var bodyParser = require('body-parser');
var express = require('express');
var app = express();

app.use(bodyParser.json()); // support json encoded bodies
app.use(bodyParser.urlencoded({ extended: true })); // support encoded bodies

app.enable('trust proxy');
app.use(express.static(__dirname + '/dist'));

app.get('/', function (req, res) {
  res.sendFile(__dirname + '/dist/index.html');
});

app.get('/article', function (req, res) {
  res.sendFile(__dirname + '/dist/article.html');
});

app.get('/identity', function (req, res) {
  res.sendFile(__dirname + '/dist/identity.html');
});

app.get('/login', function (req, res) {
  res.sendFile(__dirname + '/dist/login.html');
});

app.get('/product', function (req, res) {
  res.sendFile(__dirname + '/dist/product.html');
});

app.get('/profile', function (req, res) {
  res.sendFile(__dirname + '/dist/profile.html');
});

app.get('/search', function (req, res) {
  res.sendFile(__dirname + '/dist/search.html');
});

app.listen(80, function () {
  console.log('diw-pc app listening on port 80!');
});
